#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_textEdit_textChanged()
{
    //ui->label->setText(ui->textEdit->toPlainText());
    ui->label->setText(ui->textEdit->toMarkdown());

}

void Widget::on_textEdit_copyAvailable(bool b)
{
    qDebug() << "[copyAvailable]: " << b;
}

void Widget::on_textEdit_cursorPositionChanged()
{
    qDebug() << "[Edit_cursorPositionChanged]: " << ui->textEdit->textCursor().position();
}

void Widget::on_textEdit_redoAvailable(bool b)
{
    qDebug() << "[redoAvailable]: " << b;
}

void Widget::on_textEdit_selectionChanged()
{
    qDebug() << "[selectionChanged]: " << ui->textEdit->textCursor().selectedText();
}

void Widget::on_textEdit_undoAvailable(bool b)
{
    qDebug() << "[undoAvailable]: " << b << endl;
}
